﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class CheckToShow : MonoBehaviour {


    public string talk_key;

    public SpriteRenderer s_render;

   
    // Use this for initialization
    void Start () {
        s_render = this.GetComponent<SpriteRenderer>();
	}
	
    void CheckSetShowOrHide()
    {
        if (s_render.enabled == false)
            return;

         bool  result =  GameDataManager.Instance.GetTalkValueByKey(talk_key);
        Debug.Log(result);
        if(result == true)
        {
            s_render.enabled = false;
        }

        else
        {
            s_render.enabled = true;
        }

    }

	// Update is called once per frame
	void Update () {
        CheckSetShowOrHide();

    }
}
